<?php


namespace app\admin\controller;


use app\common\controller\BaseController;
use app\admin\model\AdminUser as user;
use think\App;

class AdminUser extends BaseController
{
    protected $model;

    public function __construct(App $app, user $adminUser)
    {
        parent::__construct($app);
        $this->model = $adminUser;
    }

    /**
     * @return array|void
     * 用户登录
     */
    public function login()
    {
        try {
            return $this->model->doLogin($this->params);
        } catch (\Exception $ex) {
            return $this->returnException($ex);
        }
    }

    /**
     * @return mixed
     * 用户信息
     */
    public function detail()
    {
        return $this->model->getDetail($this->params);
    }
}